
# 安装的xlrd==1.2.0版本，不然不支持xlsx
import xlrd

# 打开Excel
wb = xlrd.open_workbook('students.xlsx')
# 选中sheet1
sheets = wb.sheets()[0]
result = []

for i in range(1, sheets.nrows):
    student = {}
    for j in range(sheets.ncols):
        key = sheets.cell_value(0, j)
        value = sheets.cell_value(i, j)
        student[sheets.cell_value(0, j)] = value
    result.append(student)
print(result)



